<% content_tag :div, :class => 'bigwrapper' do%>
<%= flash[:error] %>
	<% content_tag :div, :class => 'editheader' do -%>
		<%= content_tag :img, nil, :src => '/images/icons/icons_35.png', :class => 'hleft' %>
		<%= content_tag :span, "<span class='smallgray'>edit line item </span>" + @line_item.first_entry.name, :class => 'hleft' %>
		<% content_tag :span, :class => 'editheadertext' do -%>
			<%= content_tag :strong, "Line item's current information:" -%>
			<%= content_tag :div, "<span class='smallgray'>Expected dollar amount </span>" + @line_item.first_entry.amount.to_s -%>
			<%= content_tag :div, "<span class='smallgray'>Note </span>" + @line_item.first_entry.note -%>
			<%= content_tag :div, "<span class='smallgray'>Status </span>" + @line_item.first_entry.status -%>
			<%= content_tag :div, "<span class='smallgray'>Last modified by </span>" + @line_item.first_entry.created_by.fname -%>
		<% end -%>
		<% content_tag :div, :class => 'container' do -%>
			<%= content_tag :span, "<strong>All notes added to this fund: </strong>" -%>
		    <% for entry in @line_item_entries %>
				<% content_tag :div, :class => 'headertext' do -%>
		            <%= content_tag(:span, entry.created_at.strftime("%Y.%m.%d"), :class=>"smallgray") %>
					<%= content_tag(:strong, entry.name) %>
					<%= content_tag(:span, entry.note) %>
		            <%= content_tag :span, entry.amount.to_s %>
				<% end -%>
		    <% end %>
			<% content_tag :div, :id => 'showoptions' do %>
		    	<% form_tag :action => 'edit' do -%>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "Add a note (<span class='red'>*</span>)<br/>"%>
						<%= text_area(:line_item_entry, :note, :size=>"46x5")%>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "Status (<span class='red'>*</span>):"%>
			            <%= select(:line_item_entry, :status, ["Opened","Closed"],:selected=>@line_item.first_entry.status) %>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "Title (<span class='red'>*</span>):"%>
			            <%= text_field(:line_item_entry, :name, :value=>@line_item.first_entry.name)%>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "Value (<span class='red'>*</span>):"%>
			            <%= text_field(:line_item_entry, :amount, :value=>@line_item.first_entry.amount)%>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "Belongs to fund (<span class='red'>*</span>):"%>
						<%= content_tag(:span,select(:line_item, :fund_id, @funds.collect {|p| [p.first_entry.name, p.id]}, { :include_blank => true, :selected => @line_item.fund_id }))%>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
			            <%= submit_tag 'Update Line Item' -%>
					<% end -%>
			    <% end %>
			<% end %>
			<% content_tag :div, :class => '' do -%>
				<%= content_tag :img, nil, :src => '/images/icons/icons_54.png', :class => 'icon' -%>
		    	<%= link_to_function "<strong>Add a note to this line item</strong>", "$('showoptions').toggle()" -%>
			<% end -%>
			<%=  javascript_tag("$('showoptions').hide()") %>
		<% end -%>
	<% end -%>
<% end -%>